package com.example.faqdemo.controller;

import com.example.faqdemo.entity.FAQ;
import com.example.faqdemo.entity.Feedback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/admin")
public class AdminController {
    @Autowired
    private FAQService faqService;

    @Autowired
    private FeedbackService feedbackService;

    // 获取所有 FAQ
    @GetMapping("/faqs")
    public List<FAQ> getAllFAQs() {
        return faqService.getAllFAQs();
    }

    // 获取所有反馈
    @GetMapping("/feedbacks")
    public List<Feedback> getAllFeedbacks() {
        return feedbackService.getAllFeedbacks();
    }
}
